package OfferCode;

/**
 * @Author Kechelle
 * @Date 2020/9/10 20:13
 * @Version 1.0
 */
public class Code4 {
    public static boolean findNumberIn2DArray(int[][] matrix,int target){
        for (int i=0;i<matrix.length;i++){
            for (int j=0;j<matrix[i].length;j++){
                if (matrix[i][j] == target) return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        int[][] martix = {{1,4,7,11,15},{2,5,8,12,19},{3,6,9,16,22},{10,13,14,17,24},{18,21,23,26,30}};
        System.out.println(Code4.findNumberIn2DArray(martix,20));
    }
}
